<template>
  <div class="box">
    <el-row :gutter="20">
      <el-col :span="6" v-for="item in hospsArr" :key="item">
        <el-card shadow="hover" class="box-card">
          {{ item }}

          <div>
            <button @click="btn">按钮</button>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>
<script setup>
import { watch, ref, reactive } from "vue";
const hospsArr = ["A", "B", "C", "D", "E"];
const props = defineProps({
  data: {
    type: Object,
    required: true,
  },
});
watch(
  () => props.data,
  (newValue, oldValue) => {
    // console.log("发送请求", newValue);
  },
  { immediate: true, deep: true }
);
let str = ref("我是子组件传过来的值");
const emit = defineEmits(["pbtn"]);
const btn = () => {
  emit("pbtn", str);
};
// console.log(props.data, "222222222");
</script>
<style lang="less" scoped>
.el-col {
  margin-bottom: 1.1667rem;
}
</style>
